This invention relates to a data logging apparatus which logs data including those stored in a programmable logic controller or those on a communication line.
FIG. 58 is a block diagram illustrating the general configuration of a conventional type of data logging apparatus, and in this figure, designated at the reference numeral 1-24 is a programmable logic controller (called PLC hereinafter), at 1-1 a memory incorporated in the PLC, at 1-15 a controller for FA (called FAC hereinafter), at 1-30 a data collecting/storing means for reading data stored in the memory 1-1 incorporated in the PLC 1-24, at 1-6 an auxiliary memory, and at 1-7 a memory.
Next, operations of the data logging apparatus according to the present invention will be described. First, a logging processing sequence in FAC 1-15 with reference to a flow chart shown in FIG. 59 will be described. The FAC 1-15 collects data from the memory 1-1 in each PLC 1-24 with the data collecting/accumulating means 1-30 (S 1-110). Then the collected data is stored in the auxiliary memory 1-6 or the memory 1-7 by the data collecting/accumulating means 1-30 (S 1-111).
FIG. 60 is a block diagram illustrating the general configuration of a conventional type of PLC, and in this figure, designated at the reference numeral 7-1 is a CPU which executes a user program, at 7-2 a memory in which programs including user programs and those for data logging are stored, at 7-3 an I/O device which turns ON an LED or inputs the state of a switch.
FIG. 61 is a block diagram illustrating contents of a PLC memory, and in this figure, designated at the reference numeral 7-8 is a program in which a program for inputting state of a switch with the I/O device 7-3 and a user program for providing LED displays or for other purposes and a data logging program for logging the state of a switch at a certain interval are combined, and at 7-9 is a device area for user programs as well as for data logging.
FIG. 62 is a functional diagram illustrating functions of a conventional type of data logging apparatus, while FIG. 63 is a flow chart illustrating operations of a conventional type of data logging apparatus. At first, the input state of a switch or other device is read from the I/O device 7-3 (S 7-4). Then, the input state is written in the device area 7-9 (S 7-5). A data logging process is executed, and the logged data is written in the device area 7-9 (S 7-6). Then the data is read from the device area, and output is executed by the I/O device (S 7-7).
FIG. 64 is a block diagram illustrating the general configuration of a conventional type of data logging apparatus, and in this figure, designated at the reference numeral 8-1 is an I/F for executing communications with the FAC, said FAC reading data stored in the device area in the PLC, accumulating the data therein, and displaying the stored data on a CRT screen, at 8-2 is an I/F for executing communications with the PLC, at 8-3 is a CPU which executes a user program for the FAC, and at 8-4 is a memory in which device data read out from the PLC or results of computing by a user program are stored.
FIG. 65 is an explanatory view showing contents of a memory in a conventional type of FAC, and in this figure, designated at 8-11 is device data read from the PLC, at 8-12 is a user program which executes processing with the device data 8-11, and at 8-13 user program data processed by the user program 8-12. The user program changes the current value (to the device data), and computes a maximum value or others from the device value. The reference numeral 8-14 indicates log data.
FIG. 66 is a block diagram illustrating the general configuration of a conventional type of data logging apparatus, while FIG. 67 is a flow chart illustrating processing operations of the data logging apparatus shown in FIG. 66. A user program reads out device data from the PLC (S 8-17). Then device data conversion is executed (for instance, * 50 (multiplication)) (S 8-18), and the converted device data is written in the user program data 8-13(S 8-19). Then a maximum value, a minimum value, an average, and a total are computed according to the device value, the values are written in the user program 8-12 (S 8-20), the device value is written in the log data 8-14, and a logging number is advanced by 1 (S 8-21).
FIG. 68 is a block diagram illustrating the general configuration of a conventional type of data logging apparatus, and in this figure, the reference numeral 9-2 indicates a clock for measuring time for reading a device value from the PLC. FIG. 70 is an explanatory drawing illustrating contents of a memory in a conventional type of FAC. In this figure, the reference numeral 9-6 indicates a user program for reading a device from the PLC and setting up a date and time, while the reference numeral 9-7 indicates log data for a current value, the date and time to be written in.
FIG. 69 is a functional drawing illustrating functions of a conventional type of data logging apparatus, while FIG. 71 is a flow chart illustrating processing operations of a conventional type of data logging apparatus. In this figure, a user program reads out a date and time from the clock and writes the values in the log data (S 9-10).
FIG. 72 is a flow chart illustrating processing operations of a conventional type of data logging apparatus. The user program checks whether there is any logging condition for execution of logging or not ( S 10-5). If logging is required, processes S 8-17 to S 8-21 are executed. Then, processing is executed using logged data, or other processing is executed (S 10-6).
FIG. 73 is a block diagram illustrating the general configuration of a conventional type of data logging apparatus, and in this figure, the reference numeral 11-1 indicates a CRT on which a result of logging is displayed, while the reference numeral 11-2 indicates a printer which prints the result of logging. FIG. 74 is an explanatory drawing showing contents of a memory in a conventional type of FAC, and in this figure, the reference numeral 11-6 indicates a user program which gives an instruction for printing to the printer 11-2. FIG. 75 is a functional drawing illustrating functions of a conventional type of data logging apparatus. FIG. 76 is a flow chart illustrating processing operations of a conventional type of data logging apparatus. The user program makes a determination as to whether displaying or printing is required or not (S 11-7), and if it is determined that such an operation is required, the operation for displaying or printing is executed (S 11-8).
FIG. 79 is a block diagram illustrating the general configuration of a conventional type of data logging apparatus, and FAC 1 and FAC 2 read a device value and execute a data logging process respectively.
FIG. 77 is a functional drawing illustrating functions of a conventional type of data logging apparatus, while FIG. 78 is a flow chart illustrating processing operations of a conventional type of data logging apparatus. The user program 13-5 for FAC 1 transmits a request for receiving a device value to the PLC (S 13-5), waits for reply from the PLC indicating reception of the device value (S 13-6), and then transmits a signal indicating that the reply was received to the PLC (S 13-7). Also the user program for the FAC 2 executes the same processing when communicating with the PLC. In the process to send and receive a signal to and from the PLC, checking that a request for receiving from the PLC is executed (S 13-8), and if the request for receiving has been issued, a reply indicating receipt is sent to the FAC (S 13-9), then, the end of receiving is awaited (S 13-10).
Technical documents relating to this invention include Japanese Patent laid-Open Publication No.18738/1983 disclosing the xe2x80x9cdata collection systemxe2x80x9d and Japanese Patent Laid-Open Publication No.241997/1989 disclosing the xe2x80x9cdata collecting apparatusxe2x80x9d.
There have been the following problems in the conventional art as described above.
Firstly, data collection must be executed for all PLCs connected to the FAC, so the number of devices required for data collection increases with an increase in the number of PLCs to be connected, and if the data collection is reduced for to raise processing, a precision in the processing, work load of the FAC becomes larger, and the precision of the data collection becomes disadvantageously lower.
Secondly, the when it is necessary to change a user program, the data logging program for the user program must also be changed, and as two functions are executed by one program, maintenance is disadvantageously difficult.
Thirdly, because all processes are executed by a user program on the user side, the work load to the user is very high, and when modifying the user program, it is necessary to the contents of the user program to carry out modifications correctly, which lowers work efficiency.
Fourthly, a clock is set up in user program in the FAC side, so it is difficult to correctly set timing for device changes on PLC side, and also time setting is executed by the user program, which makes the work load to the user program disadvantageously larger.
Fifthly, if it is desired to log as much data as possible within a short period of time (for instance with an interval of one second), other processing must be finished within a short period of time (within one second), and for this reason the user program for the other processes is disadvantageously complicated.
Sixthly, to display data or tables by a user program, a very complicated program is required, and maintenance such as modification or debugging is very troublesome, which lowers work efficiency.
Seventhly, a log time is required for giving the program a printing instruction, and during this time data logging can not be so, sometimes required data is not logged, and therefore data logging can not be executed accurately. Also the FAC program can not display and print data during data logging, so the workability thereof is very low.
Eighthly, the same processing is required in all user programs for each FAC, and in transaction with the PLC, requests from two units of FAC must be processed, which makes the work load of the PLC disadvantageously, larger and imposes some limits to expandability of the FAC.
It is an object of the present invention to provide a data logging apparatus which can raise the precision in data collection, make maintenance of the apparatus easier, and furthermore can improve the work efficiency, reduce the work load to the user program, improve the workability, reduce the work load to the PLC, and improve expandability of the FAC.
A data logging apparatus according to the present invention comprise a programmable logic controller which is packaged as a control unit in a facility or machine, one or more units of said programmable controllers being connected to each other through communications links, and a control for FAC which is connected to the programmable logic controller through communications and can read and/or write data stored in the programmable logic controller and on a communication line, wherein the programmable logic controller connected to the controller for FAC is used as an administrative programmable logic controller and the administrative programmable logic controller accumulates data stored therein or in other programmable logic controllers in a memory and provides the data to the controller for FA.
A program data preparing sequence for preparing data for a data logging program operating in the administrative programmable logic controller as well as for a data logging program running on the controller for FA is stored in the controller for FA, and the controller for FA successively processes data collected by the administrative programmable logic controller with the program described above according to data prepared by the program data preparing means.
Also, the data logging apparatus according to the present invention includes a transfer means which downloads the data logging program running on the administrative programmable logic controller from the controller for FA to the administrative programmable logic controller or uploads the aforesaid data logging program from the administrative programmable logic controller to the controller for FA.
Also, a logging setting means for describing data in a trigger condition section and a processing section is included in the controller for FA, and the logging setting means is set up in a ladder format.
Also, a logging setting means for describing data for a trigger condition section and a processing section is included in the controller for FA, and the logging setting means is set up in a tabular format.
Also the data logging apparatus according to the present invention includes an analyzing means for reading a main program (a program excluding the data logging program) of the administrative programmable logic controller and analyzing a device being used when preparing a data logging program running on the administrative programmable logic controller with program data preparing means.
Also, the data logging apparatus according to the present invention includes a program executing means for providing a program area dedicated to device logging as well as a device area in the programmable logic controller, running the data logging program in the area described above, and using the device area dedicated to data logging area.
Also the data logging apparatus according to the present invention includes a computing means for setting a magnification/offset for scale conversion in the table section setting means and executing scale conversion for the collected data.
Also, the data logging apparatus according to the present invention includes an adding means for adding data concerning date and time to stored data provided therein and a timing means for setting a clock in the programmable logic controller in accordance with that in the controller for FA.
Also, the data logging apparatus according to the present invention includes a block accumulating means for accumulating data to be stored as a plurality of successive blocks and a communicating means for indicating whether data to be accumulated is present or not.
Also, the data logging apparatus according to the present invention includes a displaying/printing format setting means for setting a format for displaying accumulated data for controller for FA or printing the data with the printing means, and a displaying/printing means for displaying or printing accumulated data for the controller for FA according to the displaying or printing format set up by the displaying/printing format setting means.
Also, the data logging apparatus according to the present invention incorporates a multi-task function in the controller for FA to provide a collecting means as well as a computing means in a given task, and also stores accumulated data for the controller for FA in a shared memory to provide the displaying/printing means in a different task.
Also, the data logging apparatus according to the present invention includes a communicating means for sending or receiving data to and from partner equipment to which accumulated data for the controller for FA is provided through communication.
The data logging apparatus according to the present invention uses a PLC connected to the FAC as an administrative PLC, and the administrative PLC accumulates data stored therein or in other PLCs in a memory and sends the data to the FAC. In other words, the administrative PLC collects data from all PLCs.
Also the FAC successively processes data collected by the data logging program according to the data section. Namely, the administrative PLC arranges the collected data into a specified format, which is processed in the lump by a FAC side.
The data logging program running on the administrative on the administrative PLC is downloaded from the FAC to the administrative PLC or uploaded from the FAC administering PLC to the FAC. In other words the FAC controls uploading and downloading of a program for the administrative PLC.
Also, a logging setting means for describing data for a trigger condition section and a processing section is included in the FAC side, and the logging setting means is set up in a ladder format.
Also, a logging setting means for describing data for a trigger condition section and a processing section is included in the FAC side, and the logging setting means is set up in a tabular format.
Also, when preparing a data logging program running on the administrative PLC with the program data preparing means, a device being used is analyzed by reading a program for the administrative PLC and the data logging program is added to eliminate the necessity of using the device in use. Thus, a device not being used by the current program is used in the data logging program.
Also a program area dedicated to data logging and a device area are provided in a PLC and each program is executed in the above areas alternately by the program executing means.
Also the computing means executes conversion of data values according to data values for accumulated data and scale change values of data for FAC corresponding to data numbers of the accumulated data, and writes the converted data in the current values of the accumulated data for FAC. Also the computing means computes the maximum values or others from the current values and writes the resultant values in the accumulated data for FAC.
The time setting means sends a request for time setting to a PLC and receives a signal indicating completion of time setting from the PLC. The adding means receives a request for time setting from the FAC and sets a date and time.
Also, the block accumulating means accumulates accumulated data as a plurality of blocks. If there is any data to be accumulated, the communicating means communicates the presence of data to be accumulated to the FAC.
The displaying/printing format setting means sets up a format for displaying accumulated data on a CRT or printing the data with a printer, and stores the format as a display/print format data in a memory of the FAC. The displaying/printing means reads the display/print format data, reads data from the accumulated data for the FAC and displays the data.
Also the displaying/printing means executes up to a process of accumulating the data in the accumulated data memory for FAC in a given task with the multi-task function (to process a plurality of tasks in a time-division system so that the plurality of tasks seem to run simultaneously), and CRT display or printer output requiring a longer processing time is executed in a different task.
Also data transaction is executed through data transaction with other FACs on a communication line between FACs, in addition to a communication between the FAC and the PLC.
As described above, with the data logging apparatus according to the present invention, it is possible to execute high speed data logging for collecting data with an administrative PLC which is a control unit, and to reduce a work load to an FAC which is a main control unit by means of distributing the work load.
Also, as it is not necessary to make a program for an administrative PLC and a program for an FAC each for data logging, reduction of a number of processes is realized.
Also, in the data logging apparatus according to the present invention, a specific device is not required for up-loading or down-loading a program for an administrative PLC.
Also, as conditions for logging are set in a ladder format or a tabular format, a user can easily set the logging condition.
Also, it is possible to make a program having several functions in one PLC.
Also, it is possible to set up different program areas or to change only a data logging program, so that a flexible data logging apparatus can be realized. Also it is possible to change only a data logging program, so that, when transferring from the FAC side, the quantity of program data to be transferred is reduced and high speed program change can be executed.
Also, it is possible to easily change a method of processing data by setting magnification/offset for scale conversion.
Also, once time setting between the FAC and the PLC is performed, time control is not required, so that the work load to the FAC side is reduced, which make it possible to execute other processes, and furthermore, as time required for data accumulation is measured in the PLC side, accurate time is stored as the accumulated data. For instance, when displaying a trend graph or others, it is possible to display sampling accurately.
Also, a plurality of accumulated data is stored in the PLC side, so that it is possible to execute a high speed logging process.
Also, it is possible to easily change a display/print format with the display/print format setting means, which improves the efficiency of maintenance work.
Also, when it is required to execute display or printing, the operation can immediately be executed, and furthermore accumulated data for FAC is stored in a shared memory, so that the data can be referred to by a user program for other tasks, which enables flexible programming.
Also, it is not necessary in the FAC to execute data collection and computing with the data collecting means and the computing means respectively from the PLC side, and also it is possible to distribute functions, so that the extendibility of the FAC can be improved. Also it is possible in the FAC to execute other processing (such as analysis of work) depending on accumulated data for FAC.
Other objects and features of this invention will become understood from the following description with reference to the accompanying drawings.